<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Grom Hellscream
 * Date: 11/2/12
 * Time: 11:06 AM
 * To change this template use File | Settings | File Templates.
 */
//no direct access
defined('_JEXEC') or die;
$username = JFactory::getUser()->username;

?>

<ul id="nav" class="dropdown">
    <!-- defining top menu elements -->
    <li><a href="<?php echo JRoute::_('index.php?option=com_vast&view=vast') ?>">Trang chủ</a></li>
    <li><a href="<?php echo JRoute::_('index.php?option=com_vast&view=cocautochuc') ?>">Cơ cấu tổ chức</a>
        <ul class="submenu">
            <?php if (!empty($list)) : ?>
                <?php foreach ($list as $item) : ?>
                    <li>
                        <a href="index.php?option=com_vast&view=donvitructhuoc&id=<?php echo $item->id; ?>">
                            <?php echo $item->ten; ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </li>
    <li><a href="<?php echo JRoute::_('index.php?option=com_vast&view=bomaylanhdao'); ?>">Bộ máy lãnh đạo</a>
    </li>
    <li><a href="<?php echo JRoute::_('index.php?option=com_vast&view=timkiemnhanvien') ?>">Tìm kiếm nhân viên</a>
    </li>
    <?php if (JFactory::getUser()->id !== 0): ?>
    <li>
        <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" name="vast-login-form" id="vast-login-form">    
        <a><?php echo $username; ?></a>
        <ul>
            <li>
                <?php if (isset($canbo) && JFactory::getUser()->authorise('vast.hosocanbo.edit.own', 'com_vast')): ?>
                <a href="<?php echo JRoute::_('index.php?option=com_vast&view=suaanhcanhan&id=' . $canbo->id); ?>">Sửa ảnh đại diện</a>
                <?php endif; ?>
                <a onclick="document.forms['vast-login-form'].submit();" href="javascript:void(0);">Đăng xuất</a>
          		<input type="hidden" name="option" value="com_users" />
          		<input type="hidden" name="task" value="user.logout" />
          		<input type="hidden" name="return" value="<?php echo $return; ?>" />
          		<?php echo JHtml::_('form.token'); ?>            
            </li>
        </ul>
        </form>
    </li>
    <?php else: ?>
    <li>
        <a href="<?php ?>">Đăng nhập</a>
    </li>
    <?php endif; ?>
</ul>